﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FarmingIndex.aspx.cs" Inherits="MaluJg.web.Stats.FarmingIndex" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>马陆镇农业办补贴</title>
    <link href="../Style/Css/Css.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../DatePicker/WdatePicker.js"></script>

    <script type="text/javascript" src="../FusionCharts/FusionCharts.js"></script>

    <script type="text/javascript" src="../Scripts/jquery.js"></script>

    <script type="text/javascript">

        function search() {

            $.ajax({
                url: "farm.aspx",
                data: { 'year': $("#tbYear").val(), 'vid': $("#ddlVillage").val(), 'nocache': Math.random() },
                timeout: 50000,
                success: function(text) {
                    var index = text.indexOf('</chart>');                    
                    var myChart1 = new FusionCharts("../FusionCharts/Column3D.swf", "myChartId", "450", "350");
                    myChart1.setDataXML(text.substring(0, index + 8));
                    myChart1.render("chartDiv");
                    var myChart2 = new FusionCharts("../FusionCharts/Pie3D.swf", "myChartId", "500", "350");
                    myChart2.setDataXML(text.substring(index + 8, text.length));
                    myChart2.render("chartDiv2");
                }
            });


        }
        function search1() {
            search();
            document.getElementById('ifrDetail').src = 'FarmTable.aspx?year=' + $("#tbYear").val() + "&vid=" + $("#ddlVillage").val()+'&nocache='+Math.random(); 
            
          
        }
        function myJS(url) {

            document.getElementById('ifrDetail').src = url+'&nocache='+Math.random();
        }     

        $(document).ready(function() {
        search();
        resetHeight();
        setInterval('resetHeight();', 500);

    });
    function resetHeight() {
        if (ifrDetail.document.body != null) {
            var nheight = ifrDetail.document.body.scrollHeight;
            if (nheight < 400) {
                nheight = 400;
            }
            document.all('ifrDetail').style.height = (nheight+30)+'px';
           
        }
    }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table cellspacing="0" cellpadding="0" border="0" class="MainTable" width="100%"
            height="100%" style="">
            <tr>
                <td width="1">
                </td>
                <td id="main" valign="top">
                    <div id="sideBar">
                        <table cellspacing="0" cellpadding="0" border="0" class="" width="100%">
                            <tr>
                                <td class="TitleBar">
                                    <table cellspacing="0" cellpadding="0" border="0" width="100%">
                                        <tr>
                                            <td class="MainTitle">
                                                马陆镇农业办补贴
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr class="ToolBar">
                                <td  colspan="2">
                                    <table>
                                        <tr valign="middle">
                                            <td>
                                                &nbsp;&nbsp;年份：
                                            </td>
                                            <td>
                                                <asp:TextBox ID="tbYear" onclick="WdatePicker({dateFmt:'yyyy'})" runat="server" CssClass="WSCL_Input"></asp:TextBox>
                                            </td>
                                            <td>
                                                村别：
                                            </td>
                                            <td>
                                                <asp:DropDownList runat="server" ID="ddlVillage">
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                                <input type="button" class="Button01" value="查询" onclick="search1()" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table cellspacing="0" cellpadding="0" border="0" width="100%">
                                        <tr>
                                            <td>
                                                <!--List Header-->
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: center">
                                    <table cellspacing="0" cellpadding="0" border="0" width="100%">
                                        <tr>
                                            <td>
                                                <div id="chartDiv" align="center" style="float: left; width: 98%">
                                                </div>
                                            </td>
                                            <td>
                                                <div id="chartDiv2" align="center" style="float: left; width: 98%">
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td align="center">
                                    <iframe width="100%" frameborder="0" src="FarmTable.aspx" id="ifrDetail" name="ifrDetail">
                                    </iframe>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
